package cn.xiyun.xiyuncc.web.controller;

import cn.xiyun.xiyuncc.dto.AliPayDto;
import cn.xiyun.xiyuncc.result.JSONResult;
import cn.xiyun.xiyuncc.service.IPayService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/pay")
public class PayController {

    @Autowired
    private IPayService payService;

    @RequestMapping("/apply")
    public JSONResult AllPay(@RequestBody AliPayDto payDto){
        return JSONResult.success(payService.AllPay(payDto));
    }

    @RequestMapping("/refund/{orderNo}")
    public JSONResult AllRefund(@PathVariable("orderNo") String orderNo){
        return JSONResult.success(payService.ChoiceRefundMethod(orderNo));
    }



}
